using System.Collections.Generic;

namespace YouVisio.Silverlight.TextDiff
{
    public struct PartsAggregationInfo<TAccumulator, TSource, TPart>
    {
        private PartsAggregationState<TAccumulator, TSource, TPart> _state;

        public PartsAggregationInfo(PartsAggregationState<TAccumulator, TSource, TPart> state)
        {
            this._state = state;
        }

        // read / write
        public TAccumulator Accumulator
        {
            get { return this._state.Accumulator; }
            set { this._state.Accumulator = value; }
        }
        // read only properties
        public IEqualityComparer<TPart> Comparer { get { return this._state.Comparer; } }
        public IPartsRetriever<TSource, TPart> Before { get { return this._state.Before; } }
        public IPartsRetriever<TSource, TPart> After { get { return this._state.After; } }
        public int InitialBeforeIndex { get { return this._state.InitialBeforeIndex; } }
        public int InitialAfterIndex { get { return this._state.InitialAfterIndex; } }
        public int Length { get { return this._state.Length; } }
        public int LastMatchBeforeIndex { get { return this._state.LastMatchBeforeIndex; } }
        public int LastMatchAfterIndex { get { return this._state.LastMatchAfterIndex; } }
        public int CurrentBeforeIndex { get { return this._state.CurrentBeforeIndex; } }
        public int CurrentAfterIndex { get { return this._state.CurrentAfterIndex; } }
        public int MaxBeforeIndex { get { return this._state.MaxBeforeIndex; } }
        public int MaxAfterIndex { get { return this._state.MaxAfterIndex; } }
        public TPart BeforeValue { get { return this._state.BeforeValue; } }
        public TPart AfterValue { get { return this._state.AfterValue; } }
        public bool SkipToCheckIfPartExists { get { return this._state.SkipToCheckIfPartExists; } }
        public bool IsDiagonal { get { return (this._state.CurrentBeforeIndex - this._state.LastMatchBeforeIndex) == (this._state.CurrentAfterIndex - this._state.LastMatchAfterIndex); } }
    }
}